﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;

namespace Bitcoin.Net
{
    /// <summary>
    /// Facade to provide .NET Framework implmentation of portable INetTcpClient.
    /// </summary>
    class FrameworkNetTcpClient : NetTcpClient
    {
        private readonly TcpClient client = new TcpClient();

        public override void Connect(string hostname, int port)
        {
            client.Connect(hostname, port);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                ((IDisposable)client).Dispose();
            }
        }

        public override Stream GetStream()
        {
            return client.GetStream();
        }
    }
}
